package adapter.objectadapter;

/**
 * @author shenhan
 * @create 2020/3/23 15:30
 * @description 适配器
 */
public class VoltageAdapter implements IVoltage5V {
    //    private Voltage220V voltage220V = new Voltage220V(); //组合
    private Voltage220V voltage220V; // 聚合

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int src = voltage220V.output220v();
        return src / 44;
    }
}
